package com.tanhua.dubbo.api;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.tanhua.dubbo.mappers.QuestionnaireMapper;
import com.tanhua.model.domain.Questionnaire;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

@DubboService
public class QuestionnaireApiImpl implements QuestionnaireApi {

    @Autowired
    private QuestionnaireMapper questionnaireMapper;

    @Override
    public List<Questionnaire> findAll() {
        LambdaQueryWrapper<Questionnaire> lqw = new LambdaQueryWrapper<>();
        lqw.orderByAsc(Questionnaire::getId);
        return questionnaireMapper.selectList(lqw);
    }
}
